home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / db / esm-3.1 / esm-3 / usr / local / sm / src / serverlib / include / link.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-05-05  |  3.6 KB  |  106 lines

  1. /*
  2.  *   $RCSfile: link.h,v $  
  3.  *   $Revision: 1.3 $  
  4.  *   $Date: 1996/05/05 03:00:44 $      
  5.  */ 
  6. #ifndef __LINK_H__
  7. #define __LINK_H__
  8.  
  9. /**********************************************************************
  10. * EXODUS Database Toolkit Software
  11. * Copyright (c) 1991 Computer Sciences Department, University of
  12. *                    Wisconsin -- Madison
  13. * All Rights Reserved.
  14. *
  15. * Permission to use, copy, modify and distribute this software and its
  16. * documentation is hereby granted, provided that both the copyright
  17. * notice and this permission notice appear in all copies of the
  18. * software, derivative works or modified versions, and any portions
  19. * thereof, and that both notices appear in supporting documentation.
  20. *
  21. * THE COMPUTER SCIENCES DEPARTMENT OF THE UNIVERSITY OF WISCONSIN --
  22. * MADISON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION.  
  23. * THE DEPARTMENT DISCLAIMS ANY LIABILITY OF ANY KIND FOR ANY DAMAGES
  24. * WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
  25. *
  26. * The EXODUS Project Group requests users of this software to return 
  27. * any improvements or extensions that they make to:
  28. *
  29. *   EXODUS Project Group 
  30. *     c/o David J. DeWitt and Michael J. Carey
  31. *   Computer Sciences Department
  32. *   University of Wisconsin -- Madison
  33. *   Madison, WI 53706
  34. *
  35. *     or exodus@cs.wisc.edu
  36. *
  37. * In addition, the EXODUS Project Group requests that users grant the 
  38. * Computer Sciences Department rights to redistribute these changes.
  39. **********************************************************************/
  40. /*
  41.  *    define structures for interfacing with the message system
  42.  */
  43.  
  44. /*
  45.  *    define the states of the link (used in LINK.flags below )
  46.  */
  47. #define LINK_FREE        0x0            /* link is unused                */
  48. #define LINK_LISTEN        0x2
  49. #define LINK_ACCEPT        0x4
  50. #define LINK_RECV        0x8
  51. #define LINK_SUSPEND    0x10
  52.  
  53. /*
  54.  *    linkClasses 
  55.  */
  56. #define CL_UNUSED            0
  57. #define CL_CONNECT            1
  58. #define CL_DISK                2
  59. #define CL_CLIENT            3
  60. #define CL_MEDIA_RECOVERY    4
  61. #define CL_STDIN            5
  62. #define CL_DGRAM            6
  63. #define CL_TIMEDOUT            7
  64. #define CL_STDOUT            8
  65. #define CL_STDERR            9
  66.  
  67. /* this cludge is modeled after MESSAGE definition and is necessary to
  68.     hack around a bug in g++-2.7.2 in linux 1.3.98
  69. */
  70. struct Link_s {
  71.     int                id;                /* index of element in Links array      */
  72.     ONE                linkClass;      /* CL_DISK, etc  above                  */
  73.     UONE            flags;          /* LINK_FREE, etc above                 */
  74.     struct   {
  75.         /* Real types aren't used here because they cause a reference loop:
  76.          * requires volume.h, which requires link.h
  77.          */
  78.         TWO /* VOLID */            volid;
  79.         char /* VOLREC */        *ptr;
  80.     }                 cached;            /* for fast path                        */
  81.     LISTELEMENT        list;            /* Free list uses this                  */
  82.     LIST            tcbList;        /* threads waiting on this link            */
  83.     LIST            volList;        /* disks open by this link                */
  84.     LIST            transList;        /* transactions controlled by link        */
  85.     LIST            resourceList;    /* resources controlled by this link    */
  86.     SOCKADDR        address;        /* not really needed, but kept for future
  87.                                        debugging or bookkeeping purposes    */
  88.     FOUR            lastForceMark;    /* force mark of last log page 
  89.                                         sent on this link, this should
  90.                                         really be of type FORCEMARK,
  91.                                         but it is defined in bf.h and
  92.                                         inconvenient to get. */
  93.  
  94.     /* Would like this to be of type TIME, but for #includes */
  95.     int                lastTxEndTime;    /* time of last abort or commit */
  96.  
  97.     int                linkTransError; 
  98.                         /* reason for previous transaction failure.
  99.                            Only set after a trans abort and reset
  100.                            to esmNOERROR when new trans is started. */
  101. };
  102. typedef struct Link_s LINK;
  103. #define link_s Link_s
  104. /*#define LINK struct link_s*/
  105. #endif __LINK_H__
  106.